<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>闲言轻博客模板 v1.0 页面目录</title>

	<link href="github-markdown.min.css" rel="stylesheet">
	<link href="monokai_sublime.min.css" rel="stylesheet">  
    <script src="highlight.min.js"></script>
    <script >hljs.initHighlightingOnLoad();</script>
	</head>
<body>
	<div class="markdown-body">
		<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;!DOCTYPE mapper PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; &quot;http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot; &gt;
&lt;mapper namespace=&quot;co.liyao.mapper.BizArticleMapper&quot; &gt;
  &lt;resultMap id=&quot;BaseResultMap&quot; type=&quot;co.liyao.model.BizArticle&quot; &gt;
    &lt;id column=&quot;id&quot; property=&quot;id&quot; jdbcType=&quot;BIGINT&quot; /&gt;
    &lt;result column=&quot;title&quot; property=&quot;title&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;result column=&quot;user_id&quot; property=&quot;userId&quot; jdbcType=&quot;BIGINT&quot; /&gt;
    &lt;result column=&quot;cover_image&quot; property=&quot;coverImage&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;result column=&quot;is-cover_image&quot; property=&quot;isCoverImage&quot; jdbcType=&quot;BIT&quot; /&gt;
    &lt;result column=&quot;type_id&quot; property=&quot;typeId&quot; jdbcType=&quot;BIGINT&quot; /&gt;
    &lt;result column=&quot;status&quot; property=&quot;status&quot; jdbcType=&quot;BIT&quot; /&gt;
    &lt;result column=&quot;recommended&quot; property=&quot;recommended&quot; jdbcType=&quot;BIT&quot; /&gt;
    &lt;result column=&quot;likenum&quot; property=&quot;likeNum&quot; jdbcType=&quot;INTEGER&quot; /&gt;
    &lt;result column=&quot;looknum&quot; property=&quot;lookNum&quot; jdbcType=&quot;INTEGER&quot; /&gt;
    &lt;result column=&quot;original&quot; property=&quot;original&quot; jdbcType=&quot;BIT&quot; /&gt;
    &lt;result column=&quot;description&quot; property=&quot;description&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;result column=&quot;dayName&quot; property=&quot;dayName&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;result column=&quot;keywords&quot; property=&quot;keywords&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;result column=&quot;comment&quot; property=&quot;comment&quot; jdbcType=&quot;BIT&quot; /&gt;
    &lt;result column=&quot;create_time&quot; property=&quot;createTime&quot; jdbcType=&quot;TIMESTAMP&quot; /&gt;
    &lt;result column=&quot;update_time&quot; property=&quot;updateTime&quot; jdbcType=&quot;TIMESTAMP&quot; /&gt;
    &lt;result column=&quot;content&quot; property=&quot;content&quot; jdbcType=&quot;LONGVARCHAR&quot; /&gt;
    &lt;association property=&quot;user&quot; column=&quot;user_id&quot; select=&quot;getUser&quot; javaType=&quot;co.liyao.model.SysUser&quot;&gt;
      &lt;id column=&quot;id&quot; property=&quot;id&quot; jdbcType=&quot;INTEGER&quot; /&gt;
      &lt;result column=&quot;username&quot; property=&quot;username&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;password&quot; property=&quot;password&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;description&quot; property=&quot;description&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;like_num&quot; property=&quot;likeNum&quot; jdbcType=&quot;INTEGER&quot; /&gt;
      &lt;result column=&quot;avatar&quot; property=&quot;avatar&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;create_time&quot; property=&quot;createTime&quot; jdbcType=&quot;TIMESTAMP&quot; /&gt;
      &lt;result column=&quot;last_login_ip&quot; property=&quot;lastLoginIp&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;/association&gt;
    &lt;association property=&quot;type&quot; column=&quot;type_id&quot; select=&quot;getType&quot; javaType=&quot;co.liyao.model.BizType&quot;&gt;
      &lt;id column=&quot;id&quot; property=&quot;id&quot; jdbcType=&quot;BIGINT&quot; /&gt;
      &lt;result column=&quot;name&quot; property=&quot;name&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;description&quot; property=&quot;description&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;/association&gt;
    &lt;collection property=&quot;tags&quot; column=&quot;tag_id&quot; javaType=&quot;ArrayList&quot; ofType=&quot;co.liyao.model.BizTags&quot;&gt;
      &lt;id column=&quot;tag_id&quot; property=&quot;id&quot; jdbcType=&quot;BIGINT&quot; /&gt;
      &lt;result column=&quot;tag_name&quot; property=&quot;name&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
      &lt;result column=&quot;tag_description&quot; property=&quot;description&quot; jdbcType=&quot;VARCHAR&quot; /&gt;
    &lt;/collection&gt;
  &lt;/resultMap&gt;

  &lt;select id=&quot;findByBizArticle&quot; parameterType=&quot;co.liyao.model.vo.BizArticleVo&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    select a.*from biz_article a
    inner join biz_type ty on ty.id = a.type_id
    inner join sys_user us on us.id = a.user_id
    inner join biz_article_tags tags on tags.article_id = a.id
    where 1=1
    &lt;if test=&quot;title!=null&quot;&gt;
      and a.title like &#39;%${title}%&#39;
    &lt;/if&gt;
    &lt;if test=&quot;typeId!=null&quot;&gt;
      and ty.id = #{typeId}
    &lt;/if&gt;
    &lt;if test=&quot;tagId!=null&quot;&gt;
      and tags.tag_id = #{tagId}
    &lt;/if&gt;
  GROUP BY a.id
    order by create_time desc
  &lt;/select&gt;
  &lt;select id=&quot;listTagsByArticleId&quot; parameterType=&quot;List&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    SELECT
    a.*,
    t.id AS tag_id,
    t.`name` AS tag_name,
    t.description AS tag_description
    FROM
    biz_article a
    INNER JOIN biz_article_tags atag ON a.id = atag.article_id
    INNER JOIN biz_tags t ON atag.tag_id = t.id
    WHERE
    a.id IN (
    &lt;foreach collection=&quot;list&quot; item=&quot;id&quot; separator=&quot;,&quot;&gt;
      #{id}
    &lt;/foreach&gt;
    )
  &lt;/select&gt;

  &lt;select id=&quot;getUser&quot; parameterType=&quot;int&quot; resultType=&quot;co.liyao.model.SysUser&quot;&gt;
       select id,username from sys_user where id=#{id}
  &lt;/select&gt;
  &lt;select id=&quot;getType&quot; parameterType=&quot;int&quot; resultType=&quot;co.liyao.model.BizType&quot;&gt;
       select *from biz_type where id =#{id}
  &lt;/select&gt;

  &lt;select id=&quot;findByBizArticleTime&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    select * from biz_article order by create_time desc limit 10
  &lt;/select&gt;


  &lt;select id=&quot;findRec&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    select * from biz_article where recommended=1 order by create_time desc limit 10
  &lt;/select&gt;

  &lt;select id=&quot;findLook&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    select * from biz_article b ORDER BY b.looknum DESC limit 10
  &lt;/select&gt;

  &lt;select id=&quot;findBizArticleById&quot; parameterType=&quot;java.lang.Integer&quot; resultMap=&quot;BaseResultMap&quot;&gt;
    select a.* from biz_article a
    inner join biz_type ty on ty.id = a.type_id
    inner join sys_user us on us.id = a.user_id
    where a.id=#{id}
  &lt;/select&gt;

&lt;/mapper&gt;
</code></pre>
	</div>
		

</body>
</html>